package com.paic.mhis.hcpms.workingArea.intergration.dao.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.warning.dto.PaginationQueryDTO;
import com.paic.mhis.hcpms.warning.dto.WarningGtasksDTO;
import com.paic.mhis.hcpms.workingArea.intergration.dao.AuditWorkingAreaDAO;
import com.paic.mhis.hcpms.workingArea.intergration.dao.WarnWorkingAreaDAO;
import com.paic.pafa.biz.dao.BaseDAO;

/**
 * 
 * @author EX-XIEQI001
 *
 */

@Component("warnWorkingAreaDao")
public class WarnWorkingAreaDaoImpl extends BaseDAO implements WarnWorkingAreaDAO{


	@Override
	public List<WarningGtasksDTO> getGtasks(PaginationQueryDTO paginationCon) {
		return (List<WarningGtasksDTO>) this._queryForList("warnWorkingArea.getGtasks", paginationCon);
	}

	@Override
	public List<Map> findWarningCount(Map<String, Object> condition) {
		List<Map> result= null;
		String type = (String) condition.get("type");
		if("JB".equals(type)){
			result = (List<Map>) this._list("warnWorkingArea.findWarningCountAgent", condition);
		}else if("SH".equals(type)){
			result = (List<Map>) this._list("warnWorkingArea.findWarningCountAudit", condition);
		}else if("SP".equals(type)){
			result = (List<Map>) this._list("warnWorkingArea.findWarningCountApprove", condition);
		}else{
			result = new ArrayList<Map>();
		}
		
		return result;
	}

}
